import random

class GenName:

    def __init__(self):

        self.MALE = "男"
        self.FEMALE = "女"

        self.__first_name = "赵钱孙李周吴郑王冯陈褚卫蒋沈韩杨朱秦尤许何吕施张孔曹严华金魏陶姜戚谢邹喻水云苏潘葛奚范郎黎" \
                          "俞任袁柳鲍史唐费岑薛雷贺倪汤滕殷罗毕郝邬安常乐于时傅卞齐康伍余元卜顾孟平鲁韦昌马苗凤花方苍" \
                          "黄和穆萧尹姚邵湛汪祁毛禹狄米贝明臧计成戴宋茅庞熊纪舒屈项祝董粱杜阮席季麻强贾桓公晋楚闫彭乔"\
                          "路娄危江童颜郭梅盛林刁钟徐邱骆高夏蔡田胡凌霍万柯卢莫房缪干解应宗丁宣邓郁单杭洪包诸左石崔吉" \
                          "龚程邢滑裴陆荣翁荀羊甄家封芮储靳邴松井富乌焦巴弓牧隗山谷车侯伊宁仇祖武符刘景詹束龙叶幸司韶"\
                          "双闻莘劳逄姬冉宰桂牛寿通边燕冀尚农温庄晏瞿茹习鱼容向古戈终居衡步都耿满弘国文东殴沃曾关红游盖益荔枝"

        self.__girl_name = "秀娟英华慧巧美娜静淑惠珠翠雅芝玉萍红娥玲芬芳燕彩春菊兰凤洁梅琳素云莲真环雪荣爱妹霞香月莺媛艳瑞凡思"\
                         "佳嘉琼勤珍贞莉桂娣叶璧璐娅琦晶妍茜秋珊莎锦黛青倩婷姣婉娴瑾颖露瑶怡婵雁蓓纨仪荷丹蓉眉君琴蕊薇菁梦影"\
                         "岚苑婕馨瑗琰韵融园艺咏卿聪澜纯毓悦昭冰爽琬茗羽希宁欣飘育滢馥筠柔竹霭凝晓欢霄枫芸菲寒伊亚宜可姬舒丽"

        self.__boy_name = "伟刚勇毅俊峰强军平保东文辉力明永健世广志义兴良海山仁波宁贵福生龙元全国胜学祥才发武新利清飞彬富顺信子"\
                        "杰涛昌成康星光天达安岩中茂进林有坚和彪博诚先敬震振壮会思群豪心邦承乐绍功松善厚庆磊民友裕河哲江超浩亮"\
                        "政谦亨奇固之轮翰朗伯宏言若鸣朋斌梁栋维启克伦翔旭鹏泽晨辰士以建家致树炎德行时泰盛雄琛钧冠策腾楠榕风航弘"

        self.__name = None
        self.__sex_val = None
        self.__sex = None
        self.__name_len = None
        

    def get_random_first_name(self):
        return random.choice(self.__first_name)

    def get_random_girl_name(self):
        return random.choice(self.__girl_name)

    def get_random_boy_name(self):
        return random.choice(self.__boy_name)

    
    def get_random_name_len(self):
        return random.randint(2, 3)

    def get_random_sex_val(self):
        return random.randint(0, 1)

    def get_sex_by_val(self, val):
        if val == 1:
            return self.MALE
        else:
            return self.FEMALE

    def generate_data(self):
        self.__name_len = self.get_random_name_len()
        self.__sex_val = self.get_random_sex_val()
        self.__sex = self.get_sex_by_val(self.__sex_val)
        if self.__name_len == 2:
            if self.__sex_val == 1:
                self.__name = self.get_random_first_name() + self.get_random_boy_name()
            else:
                self.__name = self.get_random_first_name() + self.get_random_girl_name()

        elif self.__name_len == 3:
            if self.__sex_val == 1:
                self.__name = self.get_random_first_name() + self.get_random_boy_name() + self.get_random_boy_name()
            else:
                self.__name = self.get_random_first_name() + self.get_random_girl_name() + self.get_random_girl_name()
        # return {
        #         "name" : self.__name,
        #         "sex" : self.__sex 
        # }
        return self.__name

if __name__ == "__main__":
    name = GenName()
    d = name.generate_data()
    print(d)